<template>
  <a-modal
    v-model="visible"
    title="发送短信"
    @ok="handleOk"
    :confirm-loading="confirmLoading"
    okText="立刻发送"
    @cancel="$emit('update:visible', false)"
  >
    <a-form :form="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
      <a-form-item label="短信模板">
        <a-select v-decorator="['payday', { initialValue: 1 }]" placeholder="选择月份">
          <a-select-option :value="item" v-for="item in 1" :key="item"> 模板{{ item }} </a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item label="短信内容">
        <a-textarea
          v-decorator="['remarks', { initialValue: '短信短信短信' }]"
          :disabled="true"
          placeholder="请输入"
          :auto-size="{ minRows: 4, maxRows: 10 }"
        />
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
import { postArrangeAnInterview } from "../api";
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    visible(v) {
      if (v) {
        this.form.resetFields();
        setTimeout(() => {
          this.form.setFieldsValue({
            sss: "123"
          });
        }, 100);
      }
    }
  },
  data() {
    return {
      confirmLoading: false,
      form: this.$form.createForm(this, {})
    };
  },
  methods: {
    async onPostArrangeAnInterview(v) {
      try {
        this.confirmLoading = true;
        const { data } = await postArrangeAnInterview({ ...this.mjson, ...v });
        this.confirmLoading = false;
        this.$emit("update:visible", false);
        this.$emit("onShare", data);
      } catch (err) {
        console.log("error log --> ", err);
        this.confirmLoading = false;
      }
    },
    handleOk() {
      this.form.validateFields((err, values) => {
        if (!err) {
          //   this.onPostArrangeAnInterview(values);
        }
      });
    }
  }
};
</script>

<style></style>
